<%--
  Created by IntelliJ IDEA.
  User:
  Date: 2020/7/16
  Time: 11:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
        <jsp:include page="/common/common-js.jsp"></jsp:include>
        <jsp:include page="/common/common-nav.jsp"></jsp:include>
        <jsp:include page="query-js.jsp"></jsp:include>

        <!-- 条件查询 -->
        <div class="container-fluid">
            <div class="panel panel-info">
                <div class="panel-heading">
                    <div class="panel-title">品牌查询</div>
                </div>
                <div class="panel-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="control-label col-md-2">品牌名称</label>
                            <div class="col-md-3">
                                <input type="text" name="brandName" class="form-control">
                            </div>


                            <label class="control-label col-md-2">热销品牌</label>
                            <div class="col-md-3">
                                <label class="radio-inline">
                                    <input type="radio" name="brandHot" value="0">否
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="brandHot" value="1">是
                                </label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-md-2">创建日期</label>
                            <div class="col-md-3">
                                <div class="input-group">
                                    <input type="text" name="minDate" class="form-control" id="minDate">
                                    <label class="input-group-addon">---</label>
                                    <input type="text" name="maxDate" class="form-control" id="maxDate">
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-md-4"></label>
                            <div class="col-md-3">
                                <button type="button" class="btn btn-success" onclick="query()">查询</button>
                                <button type="reset" class="btn btn-danger">重置</button>
                            </div>
                        </div>

                    </form>

                </div>
            </div>

        <button class="btn btn-success" onclick="showAdd()">新增</button>
        <!-- datatables -->
        <div class="panel panel-info">
            <div class="panel-heading">
                <div class="panel-title">品牌列表</div>
            </div>
            <div class="panel-body">

                <table id="brandTable" style="width:100%">
                    <thead>
                    <td>id</td>
                    <td>品牌名称</td>
                    <td>是否热销</td>
                    <td>排序</td>
                    <td>logo图标</td>
                    <td>创建日期</td>
                    <td>修改日期</td>
                    <td>操作</td>
                    </thead>
                </table>
            </div>
        </div>

        </div>


        <!-- 新增、修改的div-->
        <div id="aouDiv" style="display: none">
            <form class="form-horizontal">
                <input type="hidden" name="aouBrandId">
                <div class="form-group">
                    <label class="control-label col-md-2">品牌名称</label>
                    <div class="col-md-3">
                        <input type="text" name="aouBrandName" class="form-control">
                    </div>

                </div>
                <div class="form-group">
                    <label class="control-label col-md-2">热销品牌</label>
                    <div class="col-md-3">
                        <label class="radio-inline">
                            <input type="radio" name="aouBrandHot" value="0">否
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="aouBrandHot" value="1">是
                        </label>
                    </div>
                </div>

                <div class="form-group">
                    <label class="control-label col-md-2">排序</label>
                    <div class="col-md-3">
                        <div class="input-group">
                            <input type="text" name="aouBrandSort" class="form-control" id="aouBrandSort">
                        </div>
                    </div>

                </div>
                <div class="form-group">
                    <label class="control-label col-md-2">logo图</label>
                    <div class="col-md-6">
                        <div class="input-group">
                            <input type="file" id="fileImg" name="fileImg">
                            <input type="hidden" id="aouBrandLogo"/>
                        </div>
                    </div>

                </div>


            </form>
        </div>

</body>
</html>
<script>

    var datatable ;

    var aouDivHTML;

    $(function(){
        initDate("minDate");
        initDate("maxDate");
        datatable = initBrandTable();//初始化datatables
       backHtml();
    });

</script>